package com.tangding.log.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.tangding.common.utils.JacksonUtil;
import com.tangding.log.LogMatcher;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年12月20日_下午5:47:40
 *
 */
@Component
public class DelNeonLog extends LogMatcher {
	
	@Override
	public String cmdDisplay(String cmd, Object... args) {
		Object[] as = (Object[])(args[0]);
		@SuppressWarnings("unchecked")
		List<Object> ids = JacksonUtil.readValue(JacksonUtil.toJson(as[0]), List.class);
		String info = "";
		for (Object uid : ids) {
			if (info.length() > 10) {
				info += uid + "...等";
				break;
			}
			info += uid + ", ";
		}
		if (info.trim().endsWith(",")) {
			info = info.trim().substring(0, info.trim().length() - 1);
		}
		return "删除编号为【" + info +"】的跑马灯";
	}
}